<?php
/**
 * Created by PhpStorm.
 * User: win10
 * Date: 2018/8/25
 * Time: 17:13
 */
//require __DIR__.'/vendor/autoload.php';

use EasyWeChat\Factory;
$config = [
    'app_id' => 'wx74f52a333c7c0778',
    'secret' => 'dab4ada3292f273abb7529f0b79848a7',
    'token' => 'weixin',
    // 指定 API 调用返回结果的类型：array(default)/collection/object/raw/自定义类名
    'response_type' => 'array',

    'log' => [
        'level' => 'debug',
        'file' => __DIR__.'/wechat.log',
    ],
];

$app = Factory::officialAccount($config);
// 将响应输出 (服务端验证通过)
$response = $app->server->serve();

//dump($response);
require $response;
$response->send();